package edu.ucdavis.gwt.gis.client.extras;

import com.google.gwt.dom.client.Style.Cursor;
import com.google.gwt.event.dom.client.MouseDownEvent;
import com.google.gwt.event.dom.client.MouseDownHandler;
import com.google.gwt.event.dom.client.MouseOutEvent;
import com.google.gwt.event.dom.client.MouseOutHandler;
import com.google.gwt.event.dom.client.MouseOverEvent;
import com.google.gwt.event.dom.client.MouseOverHandler;
import com.google.gwt.user.client.ui.Image;

import edu.ucdavis.gwt.gis.client.resources.GadgetResources;

public class CloseButton extends Image {
	
	public CloseButton() {
		setResource(GadgetResources.INSTANCE.icon_close());
		setSize("10px", "10px");
		getElement().getStyle().setCursor(Cursor.POINTER);
		
		addMouseOverHandler(new MouseOverHandler(){
			@Override
			public void onMouseOver(MouseOverEvent event) {
				setResource(GadgetResources.INSTANCE.icon_close_u());
			}			
		});
		
		addMouseOutHandler(new MouseOutHandler(){
			@Override
			public void onMouseOut(MouseOutEvent event) {
				setResource(GadgetResources.INSTANCE.icon_close());
			}
		});
		
		addMouseDownHandler(new MouseDownHandler(){
			@Override
			public void onMouseDown(MouseDownEvent event) {
				setResource(GadgetResources.INSTANCE.icon_close());
			}
		});
	}



}
